#！bin/bash
read -p "line:" n
for ((i=1;i<=n;i++));
 do
 for ((j=i;j<=n;j++));
 do
 echo -en "    "
 done
  for ((j=1;j<=i;j++));
  do
  a=$((i-1))
  b=$((j-1))
    if [ $j == 1 ] || [ $j == $i ];
    then
     declare yh_${i}${j}=1
    else
     declare A=$((yh_${a}${j}))
     declare B=$((yh_${a}${b}))
     declare yh_${i}${j}=$((A + B))
    fi
  printf "%4d" $((yh_${i}${j}))
  echo -en "    "
  done
  printf "\n"
done